package com.foreknow.demo15;

public class B extends A {

  @Override
  public void method() {
    System.out.println("这是一个重写之后的方法");
  }

  @Override
  public void insert() {

  }

  @Override
  public void update() {

  }

  @Override
  public void delete() {

  }

  @Override
  public void query() {

  }

  public void duotai(A a) {
    a.method();
  }

  public static void main(String[] args) {
  //    A a = new B(); //父类的引用指向子类的对象
    B b = new B();
    b.duotai(b);

  }
}
